package cn.fotoit.product.schedule;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@EnableScheduling
public class AllSchedule {

    @Scheduled(fixedRate = 5000)//5秒执行一次
    public void name1() {
        System.out.println("定时任务1");

    }

    @Scheduled(cron = "0 35 14 ? * *")//每天14:35执行
    public void name() {
        System.out.println("定时任务2");

    }
}